package com.fang.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2022/5/12 1:06 上午
 **/
@Slf4j
@Component
public class TestConsumer {

    /**
     *
     * @author fanglingxiao
     * @createDateTime 2022/5/12 1:33 上午
     */
    @Service
    @RocketMQMessageListener(topic = "Test-RocketMQ", selectorExpression = "*", consumerGroup = "test-rocketmq")
    public static class Test1 implements RocketMQListener<String> {

        @Override
        public void onMessage(String s) {
            System.out.println(s);
        }
    }
}
